-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Add support for separate cassettes per DataProvider cases #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thank you for the contribution @cb-vova! It's a bit of a busy period for me, but I will try to review this as soon as possible. In meanwhile, can you maybe split this into a few smaller PRs so it'll be easier to review? |
sure. the same thing.. |
tests/AttributeDeclaredOnClassWithSeparateCassettesInSeparateFoldersTest.php
Outdated
Show resolved
Hide resolved
Thank you again @cb-vova! I left some minor comments, but in general it looks good. |
c6c9fd7
to
4d55c5f
Compare
This PR introduces comprehensive support for creating separate VCR cassettes for each PHPUnit DataProvider case, providing better isolation and organization of HTTP recordings in data-driven tests.
🚀 New Features
Enhanced UseCassette Attribute
separateCassettePerCase
: When set totrue
, creates individual cassette files for each data provider casegroupCaseFilesInDirectory
: When set totrue
, organizes separate cassette files in subdirectoriesFlexible Cassette Naming Strategies
cassette-0.yml
,cassette-1.yml
cassette-example-com.yml
,cassette-example-org.yml
cassette/0.yml
,cassette/example-com.yml
Class and Method Level Support
UseCassette
declared on test classesUseCassette
declared on individual test methods🔧 Implementation Details
Core Changes
TestCaseParameters
andTestMethodInfo
for better data handlingData Provider Name Normalization
📚 Documentation
🧪 Test Coverage
AttributeDeclaredOnClassWithSeparateCassettesInSeparateFoldersTest
AttributeDeclaredOnClassWithSeparateCassettesInSingleFolderTest
WithoutVcrTest
AttributeDeclaredOnMethodsTest
with new scenarios🔄 Backward Compatibility
💡 Usage Examples
Basic Separate Cassettes
Organized in Directories
This enhancement significantly improves the developer experience when working with data-driven tests that make HTTP requests, providing better isolation, easier debugging, and more organized test fixtures.